package lab02.test02;

public class Circle {
    //属性
    double radius;//半径
    double perimeter;//周长
    double area;//面积
    double PI = Math.PI;

    public Circle(double radius) {//有参的构造函数
        perimeter = 2 * PI * radius;
        area = PI * radius * radius;
    }

    public static void main(String[] args) {
        Circle c1 = new Circle(3);
        System.out.println("周长为：" + c1.perimeter);
        System.out.println("面积为：" + c1.area);
    }
}
